import sys; sys.path.insert(0,'third_party'); sys.path.insert(0,'.')
from twisted.internet import reactor
from twisted.python.util import println
import threading
import time
num_calls = 0
def printThreadName():
    global num_calls
    num_calls+=1
    print "current thread %s num_calls %d" % (threading.currentThread().name, num_calls)
    reactor.callLater(2,printThreadName)
    reactor.callLater(2,printThreadName)
    print "sleeping in %s - %d" % (threading.currentThread().name, num_calls)
    time.sleep(3)
reactor.callLater(0, printThreadName)
reactor.run()